#include "common.h"

vector<int> missingTwo(vector<int>& nums)
{
	int t = 0;
	for (auto x : nums) t ^= x;
	for (int i = 1; i <= nums.size() + 2; i++) t ^= i;
	int diff = 0;
	while (1)
	{
		if ((t >> diff) & 1) break;
		else diff++;
	}
	int a = 0, b = 0;
	for (auto x : nums)
	{
		if ((x >> diff) & 1) a ^= x;
		else b ^= x;
	}
	for (int i = 1; i <= nums.size() + 2; i++)
	{
		if ((i >> diff) & 1) a ^= i;
		else b ^= i;
	}
	return { a,b };
}
